package com.aote.expression;

import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.w3c.dom.Element;

import com.aote.util.ExpressionHelper;
import com.browsesoft.ExtendElement;
import com.browsesoft.htmlcomponent.HTMLBasicComponent;
import com.browsesoft.user.User;

/**
 * 表达式值产生器 从页面中查找表达式配置并进行处理
 * 
 */
public class ExpressionGenerator {

	/**
	 * 单例
	 */
	private static ExpressionGenerator self = new ExpressionGenerator();

	private ExpressionGenerator() {
	}

	public static ExpressionGenerator getInstance() {
		return self;
	}

	/**
	 * 普通页面使用,再页面中查找默认值配置,并进行处理
	 * 
	 * @return map 默认值
	 */
	public synchronized Map generateValues(Element page, Map attributes,
			User loginUser, HTMLBasicComponent component) {
		throw new UnsupportedOperationException();
	}

	/**
	 * 判断能否处理
	 */
	private boolean isFit(String occasionName, Map attrs, String name,
			Element elem, HTMLBasicComponent component) {
		return OccasionConditionFactory.getInstance().isFit(occasionName,
				attrs, name, elem, component);
	}
}